class Solution {
    vector<int> ret;
    int vis[110];
public:
    void dfs(vector<int>& digits,int sum)
    {
        if(to_string(sum).size()==3)
        {
            if(sum%2==0)
                ret.push_back(sum);
            return;
        }
        unordered_set<int> has;
        for(int i=0;i<digits.size();i++)
        {
            if(vis[i]==0 && !has.count(digits[i]))
            {
                if(sum==0 && digits[i]==0)
                    continue;
                has.insert(digits[i]);
                vis[i]=1;
                dfs(digits,sum*10+digits[i]);
                vis[i]=0;
            }
        }
    }
    vector<int> findEvenNumbers(vector<int>& digits) {
        dfs(digits,0);
        sort(ret.begin(),ret.end());
        return ret;
    }
};
